/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entityBeans;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author allankv
 */
@Entity
@Table(name = "lifestage")
@NamedQueries({
    @NamedQuery(name = "Lifestage.findAll", query = "SELECT l FROM Lifestage l"),
    @NamedQuery(name = "Lifestage.findByIdlifestage", query = "SELECT l FROM Lifestage l WHERE l.idlifestage = :idlifestage"),
    @NamedQuery(name = "Lifestage.findByLifestage", query = "SELECT l FROM Lifestage l WHERE l.lifestage = :lifestage")})
public class Lifestage implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idlifestage")
    private Integer idlifestage;
    @Basic(optional = false)
    @Column(name = "lifestage")
    private String lifestage;
    @OneToMany(mappedBy = "lifestage", fetch = FetchType.LAZY)
    private List<Occurrenceelement> occurrenceelementList;

    public Lifestage() {
    }

    public Lifestage(Integer idlifestage) {
        this.idlifestage = idlifestage;
    }

    public Lifestage(Integer idlifestage, String lifestage) {
        this.idlifestage = idlifestage;
        this.lifestage = lifestage;
    }

    public Integer getIdlifestage() {
        return idlifestage;
    }

    public void setIdlifestage(Integer idlifestage) {
        this.idlifestage = idlifestage;
    }

    public String getLifestage() {
        return lifestage;
    }

    public void setLifestage(String lifestage) {
        this.lifestage = lifestage;
    }

    public List<Occurrenceelement> getOccurrenceelementList() {
        return occurrenceelementList;
    }

    public void setOccurrenceelementList(List<Occurrenceelement> occurrenceelementList) {
        this.occurrenceelementList = occurrenceelementList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idlifestage != null ? idlifestage.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Lifestage)) {
            return false;
        }
        Lifestage other = (Lifestage) object;
        if ((this.idlifestage == null && other.idlifestage != null) || (this.idlifestage != null && !this.idlifestage.equals(other.idlifestage))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entityBeans.Lifestage[idlifestage=" + idlifestage + "]";
    }

}
